GtkAdjustment *v_adj;
GtkAdjustment *a_adj;
+ gint popup_position;
+
guint text_changed : 1;
guint use_alpha : 1;
};
{
gtk_widget_hide (editor->priv->current_popup);
editor->priv->current_popup = NULL;
+ editor->priv->popup_position = 0;
if (editor->priv->popdown_focus)
{
gtk_widget_grab_focus (editor->priv->popdown_focus);
GtkWidget *popup = NULL;
GtkWidget *toplevel;
GtkWidget *focus;
+ gint position;
+ gint s, e;
if (widget == editor->priv->sv_plane)
{
popup = editor->priv->sv_popup;
focus = editor->priv->s_entry;
+ position = 0;
}
else if (widget == editor->priv->h_slider)
{
popup = editor->priv->h_popup;
focus = editor->priv->h_entry;
+ gtk_range_get_slider_range (GTK_RANGE (editor->priv->h_slider), &s, &e);
+ position = (s + e) / 2;
}
else if (widget == editor->priv->a_slider)
{
popup = editor->priv->a_popup;
focus = editor->priv->a_entry;
+ gtk_range_get_slider_range (GTK_RANGE (editor->priv->a_slider), &s, &e);
+ position = (s + e) / 2;
}
if (popup == editor->priv->current_popup)
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (editor));
editor->priv->popdown_focus = gtk_window_get_focus (GTK_WINDOW (toplevel));
editor->priv->current_popup = popup;
+ editor->priv->popup_position = position;
gtk_widget_show (popup);
gtk_widget_grab_focus (focus);
}
if (widget == editor->priv->sv_popup)
{
+ gtk_widget_translate_coordinates (editor->priv->sv_plane,
+ gtk_widget_get_parent (editor->priv->grid),
+ 0, -6,
+ &allocation->x, &allocation->y);
if (gtk_widget_get_direction (GTK_WIDGET (overlay)) == GTK_TEXT_DIR_RTL)
allocation->x = 0;
else
allocation->x = gtk_widget_get_allocated_width (GTK_WIDGET (overlay)) - req.width;
- allocation->y = req.height / 3;
}
else if (widget == editor->priv->h_popup)
{
if (gtk_widget_get_direction (GTK_WIDGET (overlay)) == GTK_TEXT_DIR_RTL)
gtk_widget_translate_coordinates (editor->priv->h_slider,
gtk_widget_get_parent (editor->priv->grid),
- - req.width, (s + e - req.height) / 2,
+ - req.width - 6, editor->priv->popup_position - req.height / 2,
&allocation->x, &allocation->y);
else
gtk_widget_translate_coordinates (editor->priv->h_slider,
gtk_widget_get_parent (editor->priv->grid),
- alloc.width, (s + e - req.height) / 2,
+ alloc.width + 6, editor->priv->popup_position - req.height / 2,
&allocation->x, &allocation->y);
}
else if (widget == editor->priv->a_popup)
gtk_widget_translate_coordinates (editor->priv->a_slider,
gtk_widget_get_parent (editor->priv->grid),
- (s + e - req.width) / 2, - req.height,
+ editor->priv->popup_position - req.width / 2, - req.height - 6,
&allocation->x, &allocation->y);
}
else